<html>
<head>
<link href="uploadify.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript" src="jquery.uploadify.v2.1.4.min.js"></script>
</head>
<body>


<input id="file_upload" type="file" name="Filedata" /> </p>
<div id="filesUploaded" name="filesUploaded">  </div>
<script type="text/javascript">
$(function() {
  $('#file_upload').uploadify({
  'uploader'  : 'uploadify.swf',
  'script'    : 'uploadify.php',
  'cancelImg' : 'cancel.png',
  'folder'    : 'uploads',
  'removeCompleted' : true,
  'sizeLimit'   : 1024 * 1024 * 2,
'onComplete': function(event, queueID, fileObj, response, data) 
{
  while(filesUploaded.firstChild)
  {
    var oldNode = filesUploaded.removeChild(filesUploaded.firstChild);
    oldNode = null;
  }
 $('#filesUploaded').append('<img src='+fileObj.filePath+' width=400 height=400><input type=hidden value='+fileObj.filePath+' name=uploadpic');
}
  }); });
</script>
<a href="javascript:$('#file_upload').uploadifyUpload()">上传</a>




</body>
</html>
